﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace AdapterPattern
{
    class VinReporter
    {

        static void Main1()
        {

            ReportManger rm = new ReportManger();
            rm.Add("vinu");
            rm.Add("vinu");
            rm.Add("vinu");
            rm.Add("vinu");
            rm.SetReportMode(new report1());
            rm.CreateReport();


        }
    }


    abstract class ReportBase
    {
        public abstract void CreateReport(List<string> values);        
    }


    class report1 : ReportBase
    {
        public override void CreateReport(List<string> values)
        {
            Console.WriteLine("Report1 created");
        }
    }

    class report2 : ReportBase
    {
        public override void CreateReport(List<string> values)
        {
            Console.WriteLine("Report2 created");
        }
    }


    class ReportManger
    {

        private List<string> _list = new List<string>();
        private ReportBase _report;

         

        public void SetReportMode(ReportBase reportMode)
        {
            this._report = reportMode;
        }

        public void Add(string value)
        { this._list.Add(value); }

        public void CreateReport()
        {
            _report.CreateReport(_list);        
        }
    }
}
